package per.com.controller.teachermanage;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import per.com.bean.BaseBean;
import per.com.bean.teachermanage.TeacherManage;
import per.com.service.impl.teachermanage.TeachermangeService;

@Controller
@RequestMapping("/Teacher")
public class TeachermanageController {
    @Autowired
    @Qualifier("TeachermanageServiceId")
    private TeachermangeService teachermangeService;

    @RequestMapping(value = "getTeacher",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean getTeacher(){
        return new BaseBean(0,"success",teachermangeService.getTeacher());
    }
    @RequestMapping(value = "/insertnew",method = RequestMethod.POST)
    @ResponseBody
    public BaseBean insertnew(TeacherManage teacherManage){
        teachermangeService.insertnew(teacherManage);
        return new BaseBean(0,"success",teacherManage);
    }
    @ResponseBody
    @RequestMapping(value = "/deleteTeacher",method = RequestMethod.POST)
    public BaseBean deleteTeacher(String teacherid){
        teachermangeService.deleteTeacher(teacherid);
        return new BaseBean(0,"success",teacherid);
    }
}
